unit ufrmServidor;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
  System.Win.ScktComp, Vcl.ExtCtrls, uStubServidor;

type
  TfrmServidor = class(TForm)
    Panel1: TPanel;
    Memo1: TMemo;
    btnConectar: TButton;
    lblTotal: TLabel;
    ServerSocket1: TServerSocket;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
    StubServidor : TStubServidor;
  public
    { Public declarations }
  end;

var
  frmServidor: TfrmServidor;

implementation
{$R *.dfm}

procedure TfrmServidor.FormCreate(Sender: TObject);
begin
  StubServidor := TStubServidor.create;
  try
    StubServidor.SocketServidor.Active := not StubServidor.SocketServidor.Active;
    if StubServidor.SocketServidor.Active then
    begin
      btnConectar.Caption := 'Desconectar';
      Memo1.Lines.Add('Servidor ligado!');
    end
    else
    begin
      btnConectar.Caption := 'Conectar';
      Memo1.Lines.Add('Servidor Desligado!');
      lblTotal.Caption := '';
    end;
  except
    on e: exception do
      ShowMessage(e.Message);
  end;
end;



end.
